package Pm.Animals;

import java.util.Scanner;

public class AnimalTest {
    public static void main(String[] args) {
        System.out.println("你要带那个动物去医院？");
        System.out.println("1. 狗");
        System.out.println("2. 猫");
        System.out.println("3. 牛");
        Scanner sc = new Scanner(System.in);
        other:while (true) {
        int number = sc.nextInt();
            Animal animal = switch (number) {
                case 1 -> new Dog("李国威", "汪汪汪");
                case 2 -> new Cat("王程", "喵喵喵");
                case 3 -> new Cow("张艺健", "哞哞哞");
                default -> new Animal();

            };
           if (number != 1 && number != 2 && number != 3) {
               break other;
           }
            animal.isSound();
        }
    }
}
